import 'package:flutter/material.dart';
import 'package:sports_new/resources/colours.dart';
import 'package:sports_new/resources/styles.dart';
import 'package:sports_new/utils/utils.dart';
import 'package:sports_new/view/my/my_focus_team_page.dart';
import 'package:sports_new/view/my/my_focus_user_view.dart';

import '../../widgets/base/qkd_text.dart';

class MyFocusPage extends StatefulWidget {
  const MyFocusPage({super.key});

  @override
  State<MyFocusPage> createState() => _MyFocusPageState();
}

class _MyFocusPageState extends State<MyFocusPage>
    with TickerProviderStateMixin {
  late TabController _controller;
  final List<String> _tabs = ['用户'];

  @override
  void initState() {
    super.initState();
    Utils.onEvent("wdpd_gz",params: {"wdpd_gz":0});
    _controller = TabController(length: _tabs.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: Styles.appBar(
        backgroundColor: Colours.transparent,
        title: SizedBox(
          height: 34,
          child: Styles.tabbar(
              tabs: _tabs.map((f) {
                return QkdText(f);
              }).toList(),
              controller: _controller,
              onTap: (value) {
                Utils.onEvent("wdpd_gz",params: {"wdpd_gz":value});
              },
              labelPadding: EdgeInsets.symmetric(horizontal: 15),
              fontSize: 17,
              // labelPadding: const EdgeInsets.symmetric(horizontal: 13),
              scrollable: true),
        ),
      ),
      backgroundColor: Colours.scaffoldBg,
      body: TabBarView(
          controller: _controller,
          children: List.generate(_tabs.length, (index) {
            if (index == 0) {
              return const MyFocusUserView();
            }
            return Container();
          })),
    );
  }
}
